<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://www.ecside.org" prefix="ec"%>
<jsp:useBean id="pageBean" scope="request" class="com.agileai.hotweb.domain.PageBean"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>添加人员</title>
<%@include file="/jsp/inc/resource.inc.jsp"%>
<script language="javascript">
function selectRequest(){
	
	postRequest('form1',{actionType:'selectTeamStaff',showSplash:true,onComplete:function(responseText){
		hideSplash();
		if ("success" == responseText){
			parent.refresh();
			parent.PopupBox.closeCurrent();
		}
	}});
}
function setSelectTempValue(idValue,nameValue){
	ele('targetIdValue').value = idValue;
	ele('targetNameValue').value = nameValue;
}
function selectedCheck(indexId){
	var idInt = parseInt(indexId);
	var currentIndexId = idInt ;
	if($("#ec_table tr:eq("+currentIndexId+") input[name = 'USER_ID']").is(':checked')){
		$("#ec_table tr:eq("+currentIndexId+") input[name = 'USER_ID']").attr('checked',false);
	}else{
		$("#ec_table tr:eq("+currentIndexId+") input[name = 'USER_ID']").attr('checked',true);
	}
}
function doSelectRequest(){
	var ids = "";
	$("input[name='USER_ID']:checked").each(function(){   
		ids = ids+$(this).val()+",";
	});
	if (ids.length > 0){
		ids = ids.substring(0,ids.length-1);
	}
	if (ids == ""){
		writeErrorMsg('请先选中一条记录!');
		return;
	}
	selectRequest(ele('targetIdValue').value,ele('targetNameValue').value);
}
</script>
</head>
<body>
<form action="<%=pageBean.getHandlerURL()%>" name="form1" id="form1" method="post">
<%@include file="/jsp/inc/message.inc.jsp"%>
<div id="__ToolBar__">
<table class="toolTable" border="0" cellpadding="0" cellspacing="1">
<tr>
	<td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx" hotKey="V" align="center" onclick="doSelectRequest()"><input value="&nbsp;" type="button" class="saveImgBtn" title="选择" />选择</td>
	<td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx" hotKey="B" align="center" onclick="javascript:parent.PopupBox.closeCurrent();"><input value="&nbsp;" type="button" class="closeImgBtn" title="关闭" />关闭</td>        
</tr>
</table>
</div>
<div id="__ParamBar__">
<table class="queryTable">
<tr><td>
&nbsp;人员类别<select id="userType" name="userType" label="类别" onchange="doQuery()"><%=pageBean.getAttribute("userType") %></select>
&nbsp;姓名<input id="USER_NAME" label="姓名" name="USER_NAME" type="text" value="<%=pageBean.inputValue("USER_NAME")%>" size="15" class="text" />

&nbsp;<input type="button" name="button" id="button" value="查询" class="formbutton" onclick="doQuery()" />
</td></tr>
</table>
</div>
<ec:table 
form="form1"
var="row"
items="pageBean.rsList" csvFileName="添加人员.csv"
retrieveRowsCallback="process" xlsFileName="添加人员.xls"
useAjax="true" sortable="true"
doPreload="false" toolbarContent="navigation|pagejump |pagesize |export|extend|status"
width="100%" rowsDisplayed="10"
listWidth="100%" 
height="auto" 
>
<ec:row styleClass="odd" ondblclick="clearSelection();selectedCheck(${GLOBALROWCOUNT});selectRequest('${row.USER_ID}','${row.USER_NAME}')" onclick="selectedCheck(${GLOBALROWCOUNT});setSelectTempValue('${row.USER_ID}','${row.USER_NAME}')">
	<ec:column width="25" style="text-align:center" property="USER_ID" cell="checkbox" headerCell="checkbox" onclick="$(this).parents('tr').trigger('click');"/>
	<ec:column width="20" style="text-align:center" property="_0" title="序号" value="${GLOBALROWCOUNT}" />
	<ec:column width="50" property="USER_NAME" title="姓名"   />
	<ec:column width="50" property="USER_TYPE" title="类型" mappingItem="USER_TYPE"/>
</ec:row>
</ec:table>
<input type="hidden" name="PI_ID" id="PI_ID" value="<%=pageBean.inputValue("PI_ID")%>" />
<input type="hidden" name="actionType" id="actionType" />
<input type="hidden" name="targetId" id="targetId" value="<%=pageBean.inputValue("targetId")%>" />
<input type="hidden" name="targetName" id="targetName" value="<%=pageBean.inputValue("targetName")%>" />
<input type="hidden" name="targetIdValue" id="targetIdValue" value="" />
<input type="hidden" name="targetNameValue" id="targetNameValue" value="" />
<script language="JavaScript">
</script>
</form>
</body>
</html>
<%@include file="/jsp/inc/scripts.inc.jsp"%>
